<?php
    // Start players table
	TextFlush( "Dropping: {$db_prefix}players ");
	$res = $db->Execute("DROP TABLE IF EXISTS `{$db_prefix}players`");
	db_op_result($res,__LINE__,__FILE__);

    TextFlush( "Creating table: {$db_prefix}players ");
	$res = $db->Execute("CREATE TABLE IF NOT EXISTS `{$db_prefix}players` (
	`player_id` int(11) NOT NULL auto_increment,
	`currentship` int(11) NOT NULL default '0',
	`character_name` varchar(30) NOT NULL default '',
	`langdir` varchar(60) NOT NULL default '',
	`email` varchar(60) NOT NULL default 'english',
	`destroyed` char(1) NOT NULL default 'N',
	`credits` double(32,0) NOT NULL default '0',
	`turns` int(11) NOT NULL default '0',
	`turns_used` int(11) NOT NULL default '0',
	`signup_date` datetime default NULL,
	`last_login` datetime default NULL,
	`sessionid` varchar(64) NOT NULL default '',
	`logged_out` char(1) NOT NULL default 'Y',
	`forum_login` datetime default NULL,
	`rating` double(24,5) NOT NULL default '0',
	`score` double(24,0) NOT NULL default '0',
	`attackscore` double(24,0) NOT NULL default '0',
	`rank_tab` tinyint(4) NOT NULL default '0',
	`team` int(11) NOT NULL default '0',
	`team_invite` int(11) NOT NULL default '0',
	`ip_address` varchar(20) NOT NULL default '0',
	`password` varchar(100) NOT NULL default '',
	`last_team` int(11) NOT NULL default '0',
	`left_team_time` datetime default NULL,
	`team_join_count` int(11) NOT NULL default '0',
	`team_cash_countdown` int(11) NOT NULL default '0',
	`template` varchar(100) NOT NULL default '',
	`avatar` varchar(255) NOT NULL default '',
	`kills` int(11) NOT NULL default '0',
	`kill_efficiency` int(11) NOT NULL default '0',
	`deaths` int(11) NOT NULL default '0',
	`captures` int(11) NOT NULL default '0',
	`planets_built` int(11) NOT NULL default '0',
	`planets_based` int(11) NOT NULL default '0',
	`planets_destroyed` int(11) NOT NULL default '0',
	`planets_lost` int(11) NOT NULL default '0',
	`planet_update` char(1) NOT NULL default 'N',
	`profile_name` varchar(250) NOT NULL default '',
	`profile_password` varchar(250) NOT NULL default '',
	`profile_id` int(11) NOT NULL default '0',
	`profile_cached` char(1) NOT NULL default 'N',
	`ship_losses` varchar(255) NOT NULL default '',
	`map_width` int(11) NOT NULL default '50',
	`experience` double(24,2) NOT NULL default '0.00',
	`npc` int(11) NOT NULL default '0',
	`fed_bounty_count` double(6,5) NOT NULL default '0.00000',
	`fed_attack_date` datetime NOT NULL default '0000-00-00 00:00:00',
	`alliance_bounty_count` double(6,5) NOT NULL default '0.00000',
	`alliance_attack_date` datetime NOT NULL default '0000-00-00 00:00:00',
	`bounty_multiplier` double(6,5) NOT NULL default '1.00000',
	`admin` tinyint(4) NOT NULL default '0',
	`admin_extended_logging` tinyint(4) NOT NULL default '0',
	`player_online_time` int(11) NOT NULL default '0',
	`player_total_online` int(11) NOT NULL default '0',
	`allow_avatar` tinyint(4) NOT NULL default '1',
	`show_shoutbox` tinyint(4) NOT NULL default '1',
	`shoutbox_ban` tinyint(4) NOT NULL default '0',
	`show_newscrawl` tinyint(4) NOT NULL default '1',
	`enable_email_notification` tinyint(4) NOT NULL default '0',
	`enable_local_images` tinyint(4) NOT NULL default '0',
	`local_image_path` varchar(255) NOT NULL default '',
	`death_type` varchar(30) NOT NULL default '',
	`home_planet_id` int(11) NOT NULL default '0',
	PRIMARY KEY	(`player_id`),
	KEY `currentship` (`currentship`),
	KEY `email` (`email`),
	KEY `team` (`team`),
	KEY `password` (`password`),
	KEY `score` (`score`),
	KEY `last_login` (`last_login`),
	KEY `fed_attack_date` (`fed_attack_date`),
	KEY `alliance_attack_date` (`alliance_attack_date`),
	KEY `credits` (`credits`),
	KEY `forum_login` (`forum_login`),
	KEY `turns_used` (`turns_used`),
	KEY `experience` (`experience`),
	KEY `logged_out` (`logged_out`),
	KEY `profile_cached` (`profile_cached`),
	KEY `admin_extended_logging` (`admin_extended_logging`),
	KEY `kill_efficiency` (`kill_efficiency`),
	KEY `player_online_time` (`player_online_time`),
	KEY `destroyed` (`destroyed`)
) TYPE={$database_type}{$dbencoding}");
    db_op2_result("{$db_prefix}players", $res,__LINE__,__FILE__);
    // End of players table

?>